import axios from 'axios';

const baseUrl = 'http://localhost'
async function request(url, params) {
  const { data } = await axios({
    url: baseUrl + url,
    method: 'POST',
    data: params
  });

  return data;
}
export async function getSafeCode() {
  return await request('/api/safecode');
}

export async function register(params) {
  return await request('/api/user/register', params);
}

export async function personal(params) {
  return await request('/api/user/personal', params);
}

export async function login(params) {
  return await request('/api/user/login', params)
}

export async function logout(params) {
  return await request('/api/user/logout', params);
}

export async function detail(params) {
  return await request('/api/user/detail', params);
}

export async function near(params) {
  return await request('/api/recommend/near', params);
}

export async function online(params) {
  return await request('/api/recommend/online', params);
}

export async function all(params) {
  return await request('/api/active/all', params);
}

export async function share(params) {
  return await request('/api/active/share', params)
}

export async function list(params) {
  return await request('/api/message/list', params)
}

export async function history(params) {
  return await request('/api/message/history', params)
}